import request from '@/router/axios'
import store from '@/store'
import {getLineName, getStationName} from "../subwayRat/commonCheck";
export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  viewBtn: false,
  menu:true,
  editBtn: false,
  emptyBtn:false,
  delBtn: false,
  align: 'center',
  selection: true,
  reserveSelection:false,
  addBtn: false,
  column: [{
    fixed: true,
    label: '主键',
    prop: 'id',
    span: 24,
    hide: true
  }, {
    hide: false,
    label: '提交线路',
    prop: 'submitLineCode',
    type: 'select',
    search: true,
    searchslot : true,
    formatter: function(row, value , label, column){
      return getLineName(value);
    },
    // cascaderItem: ["submitStationCode"],
    // props: {
    //   label: 'name',
    //   value: 'code'
    // },
    // dicUrl: "/check/check/getLineLists?userCode="+ store.getters.userInfo.userCode,
    display: true // 动态显隐控制不能删除
  }, {
    hide: false,
    label: '提交站点',
    prop: 'submitStationCode',
    type: 'select',
    search: true,
    searchslot : true,
    formatter: function(row, value , label, column){
      return getStationName(row.submitLineCode,value);
    },
    // dicFlag: false,
    // props: {
    //   label: 'name',
    //   value: 'code'
    // },
    // dicUrl: "/check/check/getStationLists?userCode="+ store.getters.userInfo.userCode + "&lineCode={{key}}",
    display: true// 动态显隐控制不能删除
  },{
    label: '卡号',
    prop: 'cardOrder',
    hide: false,
    search: true
  },{
    width: 180,
    label: '车站提交金额/次数',
    prop: 'amount',
    hide: false,
    search: false
  },{
    width: 180,
    label: 'ACC回馈金额/次数',
    prop: 'replyAmount',
    hide: false,
    search: false
  },{
    label: '差异',
    prop: 'diffAmount',
    search: false,
    hide: false,
    type:'input',
  }, {
    label: '进站线路',
    prop: 'inLineName',
    search: false,
    hide: false,
  }, {
    label: '进站名称',
    prop: 'inStationName',
    search: false,
    hide: false,
  }, {
    label: '进站时间',
    prop: 'inTime',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    type:'datetime',
    search: false,
    hide: false,
  }, {
    label: '出站线路',
    prop: 'outLineName',
    search: false,
    hide: false,
  }, {
    label: '出站名称',
    prop: 'outStationName',
    search: false,
    hide: false,
  }, {
    hide: false,
    label: '出站时间',
    prop: 'outTime',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    type:'datetime',
    search: false
  }, {
    hide: false,
    label: '录入人',
    prop: 'inputPerson',
    search: false
  },{
    width: 100,
    hide: false,
    label: '录入人工号',
    prop: 'inputPersonCode',
    search: false
  }, {
    hide: false,
    label: '录入时间',
    prop: 'inputTime',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    type:'datetime',
    search: false
  },{
    hide: false,
    label: '状态',
    prop: 'accDataStatus',
    type: 'select',
    searchValue:1,//默认协查中
    dicData:[{label:'已协查',value:2},{label:'协查中',value:1},{label:'待下发',value:0}],
    formatter:function(row, value , label, column){
      return value == 0?'待下发':(value==1?'协查中':'已协查');
    },
    search: true
  }]
}

export function getSwStTicketInformationCheckToQF(param) {
  return request({
    url: '/check/check/getSwStTicketInformationCheckToQF',
    method: 'post',
    params: param
  })
}
export function updateSwStTicketInformationCheck(param) {
  return request({
    url: '/check/check/updateSwStTicketInformationCheck',
    method: 'post',
    params: param
  })
}
export function updateSwStTicketInformationCheckToQF(param) {
  return request({
    url: '/check/check/updateSwStTicketInformationCheckToQF',
    method: 'post',
    params: param
  })
}

export function importTicketFileQF(param) {
  return request({
    url: '/check/check/importTicketFileQF',
    method: 'post',
    params: param
  })
}
